//
// Created by Administrator on 2024/11/19.
//

#ifndef AI_PACS_SEARCHID_H
#define AI_PACS_SEARCHID_H
#define BASE62  "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"
#define SALT  "umef"

#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <ctime>
#include <stdexcept>
#include <bitset>
#include <zlib.h>
#include <gmpxx.h>
#include <vector>
#include <format>
#include <gmpxx.h>
#include "log.h"
#include "OpenSSLUtils.h"


class SearchId {

public:
    static std::string expired_encode(const std::string &search_id, unsigned int life_span);

    static std::vector<std::string> expired_decode(const std::string &encode_str);

    static std::string crc32_checksum(const std::string &input);

    static std::string base62_encode( const mpz_class &n, const std::string &charset = BASE62);

    static std::string base62_decode(const std::string &str,const std::string &charset = BASE62);

    std::string to_hex(unsigned char c);

    static std::string StringToHex(const std::string &data);

    static std::string HexToStr(const std::string &str);

    static std::vector<unsigned char> hexToBytes(const std::string &hex);

    static std::string hex_to_bytes(const std::string &hex);

    static std::string convert_string_to_base62_by_sha1(const std::string &input);
};


#endif //AI_PACS_SEARCHID_H
